package com.smarttest.common.beans;

public class GeneralResultWithStatus {
	private String status;
	private String url;
	private String message;
	private Object data;

	private GeneralResultWithStatus(String status, String url, String message,Object data) {
		this.status = status;
		this.url = url;
		this.message = message;
		this.data = data;
	}

	// 成功时调用的方法
	public static GeneralResultWithStatus ok(String url,String message) {
		return new GeneralResultWithStatus("succ", url, message,null);
	}
	
	// 成功时调用的方法
	public static GeneralResultWithStatus okData(String url,Object data) {
		return new GeneralResultWithStatus("succ", url,null,data);
    }
	
	// 成功时调用的方法
	public static GeneralResultWithStatus ok(String url) {
		return new GeneralResultWithStatus("succ", url, null,null);
    }

	// 失败时调用的方法
	public static GeneralResultWithStatus error(String url,String message) {
		return new GeneralResultWithStatus("error", null, message,null);
	}
	
	public static GeneralResultWithStatus error(String message) {
		return new GeneralResultWithStatus("error", null, message,null);
	}
	public static GeneralResultWithStatus error(String message,Object data) {
		return new GeneralResultWithStatus("error", null, message,data);
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
}
